Skip to content

Conversation

@gssmay
Copy link

@gssmay gssmay commented Oct 27, 2021

No description provided.

Copy link
Owner

@codecodecoder78 codecodecoder78 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try to run your code to ensure it at least starts

def hello_world():
return "Welcome to the database!"

app.run
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not do anything. Please look into the correct way to start the app on the notes. app.run is correct but needs more arguments

def get_details(id):
try:
if request.method == 'GET':
return {"Status": "Success", "Data": db[id]}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when id is not valid

def get_details(id):
try:
if request.method == 'GET':
return {"Status": "Success", "Data": db[id]}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when id is not valid

def register():
username = request.args.get('username')
pw = request.args.get('passwordHash')
credentials.append({"username": username, "passwordHash": pw})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defensive programming: Check that input is not "" or None to ensure that its a valid input

token = request.args.get('token')
if token != None:
try:
user_details = jwt.decode(token, current_app.config['SECRET_KEY'], algorithms="HS256")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants